import request from "@/utils/request";

export const add = (params) => {
  const { trainCode, carriageIndex, seatRow, col, seatType, carriageSeatIndex } = params;
  return request.post("/system/train-seat/add", {
    trainCode, carriageIndex, seatRow, col, seatType, carriageSeatIndex
  });
};

export const getPage = (pageNo, pageSize, search) => {
  const { code } = search;
  return request.post("/system/train-seat/page", {
    pageNo,
    pageSize,
    code
  });
};

export const remove = (id) => {
  return request.delete(`/system/train-seat/remove/${id}`);
};

export const edit = (params) => {
  const { id, trainCode, carriageIndex, seatRow, col, seatType, carriageSeatIndex } = params;
  return request.post("/system/train-seat/edit", {
    id, trainCode, carriageIndex, seatRow, col, seatType, carriageSeatIndex
  });
};
